package basetest.wsf

/**
  * Created by shouf on 2016/5/12.
  */
object forExceptionTest extends App {
  val person1 = Person3("wsf", true, "w1", "w2")
  val person2 = Person3("wn", false, "w3", "w4")
  val list = List(person1, person2)
  val res = list filter(_.male) flatMap(per => per.children map(c => (per.name, c)))
  println(res)

  val res2 = for (per <- list if per.male; c <- per.children) yield (per.name, c)
  println(res2)
}

case class Person3(name:String, male:Boolean, children:String*)